<?php
abstract class Animal {//abstract抽象
	//内部外部都可访问
	public $nick;
	public $age;
	public $sex;
	function move(){
		echo $this -> age . "岁的", $this -> sex, $this -> nick . "正在跑速度";
	}
	abstract function say();//抽象方法必须包含在抽象类中
	abstract function run($num);
}
interface IFly{//接口
	function fly();
}
class Dog extends Animal{
	function say() {
		echo "汪汪";
	}
	function run($n) {
		echo $n."米每秒";
	}
}
class Cat extends Animal{
	function say() {
		echo "喵喵";
	}
	function run($n) {
		echo $n."米每秒";
	}
}
//鹦鹉类
class Parrot extends Animal implements IFly{
	function say(){
	   echo "渣渣渣";
	}
	function run($n){
	   echo $n."米每秒";
	}
	function fly(){
		echo "正在飞";
	}
}
//一个列只能有一个父类
class A extends Parrot {
	
}
$xiaohua=new Dog("小花",2,"母");
$xiaohua->say();
$bage=new A();
$bage->fly();
?>